package main

import (
	"context"
	"fmt"
	"mxshop_srvs/goods_srv/proto"
)

func TestGoodsList() {

	list, err := client.GoodsList(context.Background(), &proto.GoodsFilterRequest{
		//PriceMin:    0,
		//PriceMax:    0,
		//IsHot:       false,
		//IsNew:       false,
		TopCategory: 1001,
		Pages:       1,
		PagePerNums: 10,
		//Brand:       0,
	})
	if err != nil {
		panic(err)
	}
	for _, val := range list.Data {
		fmt.Println(val)
	}
}

func TestBatchGetGoods() {
	goodsListResponse, err := client.BatchGetGoods(context.Background(), &proto.BatchGoodsIdInfo{Id: []int32{9, 10, 11, 12, 13}})
	if err != nil {
		panic(err)
	}
	for _, goods := range goodsListResponse.Data {
		fmt.Println(goods)
	}
}
